using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Bullet : MonoBehaviour
{
    public Rigidbody2D _rigdbody;
    public float speed = 50.0f;
    public float maxLife = 10.0f;


    private void Awake()
    {
        _rigdbody = GetComponent<Rigidbody2D>();
    }

    public void Project(Vector2 direction)
    {
        _rigdbody.AddForce(direction * this.speed);
        Destroy(this.gameObject, this.maxLife);
    }
}
